//gen.h
#ifndef GEN_H
#define GEN_H

#include <stdlib.h>
#include <stdio.h>
#include "tree.h"

typedef struct IList {
	char *instr;		//SQL instruction
	struct IList* next;	// next instruction
} instruction;


//global vars--------------------------------------------------------------
instruction *instrlist;		//list of instructions
instruction *currlist;		//points to end of list of instructions


//functions--------------------------------------------------------------
void TraverseTree(node *n);	//traverses the tree
instruction* CreateInstruction(node *n);	//creates an SQL instruction
char* GetFrom(node *n);
char* GetSelect(node *n);
char* GetWhere(node *n);

void PrintList(instruction* l);

//char* ConverttoSQL();

#endif
